Fragment

data class Fragment(@IdRes val containerId: Int, val type: NavigationSpec.Fragment.Type = Type.Replace, val tag: String? = null, val backStackSettings: NavigationSpec.Fragment.BackStackSettings = BackStackSettings.DontAdd, val animationSettings: NavigationSpec.Fragment.AnimationSettings? = null, val getFragmentManager: ActivityLifecycleSubscribable.LifecycleManager.() -> FragmentManager = { fragmentManager }, val createFragment: () -> Fragment) : NavigationSpec

Shows a androidx.fragment.app.Fragment

Parameters

containerId

The identifier of the View containing the fragment

type

The Fragment.Type of transaction. Defaults to Fragment.Type.Replace

tag

Optional tag of the fragment transaction

backStackSettings

The BackStackSettings of the transaction. Defaults to BackStackSettings.DontAdd

animationSettings

Optional AnimationSettings for the transaction

getFragmentManager

Optional getter for the FragmentManager to handle showing the Fragment

createFragment

Function to create the androidx.fragment.app.Fragment

Constructors

Link copied to clipboard
constructor(@IdRes containerId: Int, type: NavigationSpec.Fragment.Type = Type.Replace, tag: String? = null, backStackSettings: NavigationSpec.Fragment.BackStackSettings = BackStackSettings.DontAdd, animationSettings: NavigationSpec.Fragment.AnimationSettings? = null, getFragmentManager: ActivityLifecycleSubscribable.LifecycleManager.() -> FragmentManager = { fragmentManager }, createFragment: () -> Fragment)

Types

Link copied to clipboard
data class AnimationSettings(@AnimatorRes @AnimRes val enter: Int = 0, @AnimatorRes @AnimRes val exit: Int = 0, @AnimatorRes @AnimRes val popEnter: Int = 0, @AnimatorRes @AnimRes val popExit: Int = 0)

Settings for animation during the fragment transaction

Link copied to clipboard
sealed class BackStackSettings

Settings for whether the androidx.fragment.app.Fragment should be added to the Backstack

Link copied to clipboard
sealed class Type

Type of fragment transaction.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val tag: String? = null
Link copied to clipboard